<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS static</title>
</head>
<body>
<p id="demo"></p>

<script>
  class Car {
    constructor(name) {
      this.name = name;
    }
    static hello(x) {
      return "Hello " + x.name;
    }
  }

  let myCar = new Car("Ford");
  //可以在 Car 类上调用 'hello()'，但不能在 Car 对象上调用
  document.getElementById("demo").innerHTML = Car.hello(myCar);
</script>
</body>
</html>